1. Field of the Invention
The present invention relates to an optical disc apparatus, and more particularly to technology for managing a buffer memory storing data to be recorded and data to be reproduced.
2. Description of the Related Art
In disc apparatuses other than a floppy disc device (FDD) having been widely used as an auxiliary storage device on a computer, such as a hard disc device (HDD), an optical disc apparatus, and the like, a microcomputer is included to realize recording and reproducing of high-volume data at a high speed.
Compared with a HDD, an optical disc apparatus is inferior in random access responsivity because of the weight of an optical head and a head carriage. With this in mind, when recording data in an optical disc apparatus, data associated with a data recording command (hereinafter referred to as “a write command”) issued from a host device is received in a buffer memory, and a recording finished status is reported to the host device immediately after the completion of receiving the data, to thereby improve apparent data recording speed viewed from the host device. The optical disc apparatus is configured to actually write data associated with a normal write command on an optical disc only after the data receiving becomes impossible due to depletion of available free space, or after a predetermined period of time has elapsed from the receipt of the last write command. This manner of writing is well known, and is usually referred to as “delayed write”. The delayed write is implemented by firmware in a microcomputer, and performance (responsivity) of the disc apparatus viewed from a host varies depending on how the delayed write is performed.
As such a write command issued from a host device, there exist a normal write command and a write command with an FUA (Force Unit Access) bit. Data associated with the write command in which the FUA bit is set is not subjected to delayed write operation, and the received data is recorded immediately after completion of accumulation in the buffer memory. This command is often attached to data which would cause great damage if recording of the data ended in failure, such as directory information constituting a file system in an OS.
When data is recorded on a sector-formatted optical disc apparatus, such as a DVD-RAM, or the like, write data attached to a write command sent from a host device (a host) is received in a buffer memory rather than being actually recorded on the optical disc, and the completion of execution of the command is reported to the host upon finishing the receipt of the data in the buffer memory. In other words, the above-described delayed write is performed. Unrecorded data having been accumulated in the buffer memory is actually recorded on the optical disc at the timing as described below.
(1) Sequential Write
When the write data attached to write commands sequentially sent from the host has continuous LBAs (Logical Block Addresses), it is determined that the data is continuously recorded without a seek operation of an optical pickup, and receiving of the data is continued until a buffer becomes full (a buffer full state). Then, at a time when the buffer enters the full state, or when a predetermined period of time has elapsed without receiving a command from the host after receipt of the last write command, the data recording on the optical disc (real recording) is initiated.
(2) Random Write
When the write data attached to the write commands sequentially sent from the host has discontinuous LBAs, it is determined that a recording operation is performed on discontinuous physical addresses on the optical disc, thereby requiring the seek operation of the optical pickup. Based on this determination, a counter for counting data sets having discontinuous logical block addresses is incremented by +1. The counter is incremented every time the discontinuous write data is received, and when the counter reaches a predetermined value, for example, a value of 10, the real recording is started (the size of the buffer is artificially reduced) regardless of whether or not the buffer full state is reached. Because the seek operation is a time-consuming process and likely to introduce a situation in which the host is kept waiting, or may occasionally raise the possibility that a time-out error is output from the host, it is necessary to perform the writing as described above. It is also possible to initiate the real writing, similarly to the sequential write, at the time when a predetermined period of time has elapsed after receiving the last command even if the counter has not reached the predetermined value.
Japanese Patent Laid-Open Publication No. 2000-339856 discloses a method of using a buffer memory.
Conventionally, in either of the above-described cases (1) and (2), once the real recording on a disc is initiated, it becomes impossible to immediately respond to a read/write command sent from the host until unrecorded data in the buffer memory is entirely recorded.
In the random write, a restriction is imposed using a discontinuity counter to artificially reduce the size of the buffer memory as described above, which can prevent timeout from the host. In the sequential write, on the other hand, high-speed writing is naturally expected from the use of the maximum size of the buffer memory. However, an execution time of the recording is immediately increased once a switching process occurs, which results in a rapid decrease in responsivity. The responsivity is degraded in proportion to the size of the buffer memory, and, at worst, could be degraded to the extent that the host determines a timeout resulting in a bus reset. Even though the size of the buffer memory is increased to improve the responsivity, the increased size would exert an adverse effect upon the occurrence of the switching process. An event of the bus reset means that the recording is interrupted by the host, which might pose a risk of losing user's confidence in the optical disc apparatus.